<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:73:"E:\workplace\project\Sunwm\web/../application/admin\view\seller\desk.html";i:1512796171;s:75:"E:\workplace\project\Sunwm\web/../application/admin\view\public\header.html";i:1503189484;s:74:"E:\workplace\project\Sunwm\web/../application/admin\view\public\pages.html";i:1509260822;s:75:"E:\workplace\project\Sunwm\web/../application/admin\view\public\footer.html";i:1512624954;}*/ ?>
﻿<!DOCTYPE html>
<html lang="zh-cn">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title><?php echo config('sitename'); ?>-<?php echo lang('label')['Login_title']; ?></title>
		<link rel="stylesheet" type="text/css" href="__ROOT__/static/public/css/pintuer.css" />
		<link rel="stylesheet" type="text/css" href="__ROOT__/static/admin/css/admin.css" />
		<script type="text/javascript" src="__ROOT__/static/public/js/jquery.js"></script>
		<script type="text/javascript" src="__ROOT__/static/public/js/pintuer.js"></script>
		<script type="text/javascript" src="__ROOT__/static/admin/js/admin.js"></script>
		<script type="text/javascript" src="__ROOT__/static/public/layer/layer.js"></script>
		<script type="text/javascript" src="__ROOT__/static/public/laydate/laydate.js"></script>
		<script type="text/javascript" src="__ROOT__/static/public/laytpl/laytpl.js"></script>
	</head>

	<body>
	<style>
		html { overflow-x:hidden; }
	</style>
<form method="post">
    <div class="panel admin-panel">
        <div class="panel-head"><strong>商家 <?php echo input('get.name'); ?> 的桌台<?php echo lang('currency')['list']; ?></strong>
            <a style="float: right;margin-right: 15px" href="__URL__/?page=<?php echo input('get.page'); ?>"><< 返回</a>
        </div>
        <div class="padding border-bottom">
            <input type="button" class="button button-small checkall" name="checkall" checkfor="id"
                   value="<?php echo lang('currency')['all_select']; ?>"/>
            <a type="button" class="button button-small border-green" href="__URL__/desk_edit?seller_id=<?php echo input('get.id'); ?>&name=<?php echo input('get.name'); ?>&page=<?php echo input('get.page'); ?>"/><?php echo lang('currency')['add']; ?></a>
            <a id="select_del" type="button" class="button button-small border-red" href="#"/><?php echo lang('currency')['del']; ?></a>
        </div>
        <table class="table table-hover">
            <tr>
                <th width="35"><?php echo lang('label')['select']; ?></th>
                <th width="100">名称</th>
                <th width="100">二维码</th>
                <th width="150"><?php echo lang('label')['handle']; ?></th>
            </tr>
            <?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$desk): $mod = ($i % 2 );++$i;?>
            <tr>
                <td>
                    <input type="checkbox" name="id" value="<?php echo $desk['id']; ?>"/>
                </td>
                <td style="line-height:40px"><?php echo $desk['title']; ?></td>
                <td style="line-height:40px">
				<img style="width:80px;height:80px;" src="http://qr.liantu.com/api.php?text=<?php echo $desk['code']; ?>"/>
				</td>
                <td style="line-height:40px"><a class="button border-blue button-little" href="__URL__/desk_edit?id=<?php echo $desk['id']; ?>&seller_id=<?php echo input('get.id'); ?>&name=<?php echo input('get.name'); ?>&page=<?php echo input('get.page'); ?>"><?php echo lang('currency')['edit']; ?></a>
                    <a class="button border-red button-little" href="__URL__/desk_del.html?id=<?php echo $desk['id']; ?>&seller_id=<?php echo input('get.id'); ?>&name=<?php echo input('get.name'); ?>&page=<?php echo input('get.page'); ?>" onclick="if(confirm('<?php echo lang('currency')['del']; ?>?')){return true;}return false;"><?php echo lang('currency')['del']; ?></a>
                </td>
            </tr>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </table>
        <?php if($pages['pagetotal'] > 1): 
	$get_arr = request()->get();
	$parameters = '';
	if(count($get_arr) > 0){
		foreach($get_arr as $k => $v){
			if($k != 'page'){
				$parameters .= '&'.$k.'='.$v;
			}
		}
	}
	 ?>
	<div class="panel-foot text-center">
		<ul class="pagination green">
			<li><a href="#">共<?php echo $pages['total']; ?>条数据</a></li>
		</ul>
		<?php if($pages['page'] > 1): ?>
		<ul class="pagination">
			<li><a href="?page=<?php echo $pages['page']-1; ?><?php echo $parameters; ?>">上一页</a></li>
		</ul>
		<?php endif; ?>
		
		<ul class="pagination pagination-group">
		<?php $__FOR_START_20926__=1;$__FOR_END_20926__=$pages['pagetotal']+1;for($i=$__FOR_START_20926__;$i < $__FOR_END_20926__;$i+=1){ ?>
		<li><a href="?page=<?php echo $i; ?><?php echo $parameters; ?>" <?php if($pages['page']==$i): ?>class="active"<?php endif; ?>><?php echo $i; ?></a></li>
		<?php } ?>
		</ul>
		<?php if($pages['page'] < $pages['pagetotal']): ?>
		<ul class="pagination">
			<li><a href="?page=<?php echo $pages['page']+1; ?><?php echo $parameters; ?>">下一页</a></li>
		</ul>
		<?php endif; ?>
	</div>
<?php endif; ?>

    </div>
</form>
<script>
    layer.config({
        extend: 'extend/layer.ext.js'
    });
    $('#select_del').click(function () {
        var str = "";
        $("input:checkbox[name=id]:checked").each(function () {
            str += $(this).val() + ",";
        });
        if (str != '') {
            if (confirm("<?php echo lang('currency')['del']; ?>?"))
            {
                location.href = '__URL__/desk_del.html?id=' + str;
            }
        }
    });
</script>
<p class="text-center text-gray" style="margin-top:10px;"><a class="text-gray" target="_blank" href="http://www.wm0530.com">完美外卖系统 Power by 网络工厂</a></p>
</body>
<script>
$('.upload').on('click',function (){
		var id = $(this).attr('data-id');
		 upload(id);
	}
);
function upload(id){
	layer.open({
		type:2,
		title:false,
		area: ['70%', '90%'],
		offset: '5%',
		content: "<?php echo url('/admin/material'); ?>?id="+id
	});
}
</script>
</html>